/*
 ============================================================================
 Name		: YuebaoCommonListboxItem.h
 Author	  : 
 Version	 : 1.0
 Copyright   :
 Description : YuebaoCommonListboxItem declaration
 ============================================================================
 */

#ifndef YuebaoCommonListboxItem_H_
#define YuebaoCommonListboxItem_H_

// INCLUDES
#include <e32std.h>
#include <e32base.h>
#include "fFramework.h"
#include "fListbox.h"
#include "YuebaoSplashString.h"

// CLASS DECLARATION

/**
 *  YuebaoCommonListboxItem
 *
 */
class YuebaoCommonListboxItem : public fListBoxItem/* public fListBoxItem*/
{
public:
    // Constructors and destructor

    /**
     * Destructor.
     */
    ~YuebaoCommonListboxItem( );

    /**
     * Two-phased constructor.
     */
    static YuebaoCommonListboxItem* NewL( fEngine* aFramework, const TDesC& aString, fImage* normal, fImage* hilite, fImage* pushed );

    /**
     * Two-phased constructor.
     */
    static YuebaoCommonListboxItem* NewLC( fEngine* aFramework, const TDesC& aString, fImage* normal, fImage* hilite, fImage* pushed );

private:

    /**
     * Constructor for performing 1st stage construction
     */
    YuebaoCommonListboxItem( );

    /**
     * EPOC default constructor for performing 2nd stage construction
     */
    void ConstructL( fEngine* aFramework, const TDesC& aString, fImage* normal, fImage* hilite, fImage* pushed );
public:
    void RenderFrame( );
public:
    void DrawHilite( );
public:
    HBufC* _title;
    fImage* _bg_hilite;
    fImage* _bg_normal;
    fImage* _bg_pushed;
    //fImage* _curseIcon;
protected:
    void DrawItem( bool hilite, int x, int y );
protected:
    int DrawNormal( int x, int y )
    {
        DrawItem( false, x, y );
        return 0;
    }
    int DrawHilite( int x, int y )
    {
        DrawItem( true, x, y );
        return 0;
    }
protected:
    CFont* _font;
private:
    void Layout( );
private:
    int _text_y_offset;
    int _text_x_offset;
    bool _layouted;
    DrawableString _splashString;
};

#endif // YUEBAOCATELISTBOXITEM_H
